package ge.tsu.java.project.server;

import ge.tsu.java.project.commons.Contact;
import ge.tsu.java.project.commons.Contact.Status;

import java.util.ArrayList;

public class MockCPEngine implements ClientProcessorEngine {
	
	@Override
	public boolean authenticate(String userId, String password) {
		return true;
	}

	@Override
	public boolean register(String userId, String password) {
		return true;
	}

	@Override
	public ArrayList<Contact> getContactsOf(String who) {
		ArrayList<Client> clients = Server.getOnlineClients();
		ArrayList<Contact> contacts = new ArrayList<>(clients.size());
		for (Client c : clients) {
			contacts.add(c.toContact(Status.ONLINE));
		}
		return contacts;
	}

}
